home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 9.9 KB | 237 lines | [TEXT/MPS ] |
- (*
- File: ADSP.mod
-
- Contains: AppleTalk Data Stream Protocol (ADSP) Interfaces.
-
- Version: Technology: System 7.5
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE ADSP;
-
- IMPORT SYSTEM, Types, OSUtils, AppleTalk;
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)
-
- CONST
- dspInit* = 255; (* create a new connection end *)
- dspRemove* = 254; (* remove a connection end *)
- dspOpen* = 253; (* open a connection *)
- dspClose* = 252; (* close a connection *)
- dspCLInit* = 251; (* create a connection listener *)
- dspCLRemove* = 250; (* remove a connection listener *)
- dspCLListen* = 249; (* post a listener request *)
- dspCLDeny* = 248; (* deny an open connection request *)
- dspStatus* = 247; (* get status of connection end *)
- dspRead* = 246; (* read data from the connection *)
- dspWrite* = 245; (* write data on the connection *)
- dspAttention* = 244; (* send an attention message *)
-
- dspOptions* = 243; (* set connection end options *)
- dspReset* = 242; (* forward reset the connection *)
- dspNewCID* = 241; (* generate a cid for a connection end *)
- (* connection opening modes *)
- ocRequest* = 1; (* request a connection with remote *)
- ocPassive* = 2; (* wait for a connection request from remote *)
- ocAccept* = 3; (* accept request as delivered by listener *)
- ocEstablish* = 4; (* consider connection to be open *)
- (* connection end states *)
- sListening* = 1; (* for connection listeners *)
- sPassive* = 2; (* waiting for a connection request from remote *)
- sOpening* = 3; (* requesting a connection with remote *)
- sOpen* = 4; (* connection is open *)
- sClosing* = 5; (* connection is being torn down *)
- sClosed* = 6; (* connection end state is closed *)
- (* client event flags *)
- eClosed* = $80; (* received connection closed advice *)
- eTearDown* = $40; (* connection closed due to broken connection *)
- eAttention* = $20; (* received attention message *)
- eFwdReset* = $10; (* received forward reset advice *)
- (* miscellaneous constants *)
- attnBufSize* = 570; (* size of client attention buffer *)
- minDSPQueueSize* = 100; (* Minimum size of receive or send Queue *)
-
- (* connection control block *)
-
- TYPE
- TPCCB* = POINTER TO TRCCB;
-
- TRCCB* = (*ΔΔPACKEDΔΔ*) RECORD
- ccbLink*: TPCCB (*ΔΔ POINTER TO TRCCB*); (* link to next ccb *)
- refNum*: Types.UInt16; (* user reference number *)
- state*: Types.UInt16; (* state of the connection end *)
- userFlags*: Types.UInt8; (* flags for unsolicited connection events *)
- localSocket*: Types.UInt8; (* socket number of this connection end *)
- remoteAddress*: AppleTalk.AddrBlock; (* internet address of remote end *)
- attnCode*: Types.UInt16; (* attention code received *)
- attnSize*: Types.UInt16; (* size of received attention data *)
- attnPtr*: Types.Ptr; (* ptr to received attention data *)
- reserved*: (*ΔΔPACKEDΔΔ*) ARRAY 220 (*ΔΔ[0..219]ΔΔ*) OF Types.UInt8; (* for adsp internal use *)
- END;
-
- DSPPBPtr* = POINTER TO DSPParamBlock;
-
- (*
- ADSPConnectionEventProcPtr uses register based parameters on the 68k and cannot
- be written in or called from a high-level language without the help of
- mixed mode or assembly glue.
-
- In*:
- => sourceCCB A1.L
- *)
- ADSPConnectionEventProcPtr* = Types.Register68kProcPtr; (* register PROCEDURE ADSPConnectionEvent*(sourceCCB: TPCCB); *)
- (*
- ADSPCompletionProcPtr uses register based parameters on the 68k and cannot
- be written in or called from a high-level language without the help of
- mixed mode or assembly glue.
-
- In*:
- => thePBPtr A0.L
- *)
- ADSPCompletionProcPtr* = Types.Register68kProcPtr; (* register PROCEDURE ADSPCompletion*(thePBPtr: DSPPBPtr); *)
- ADSPConnectionEventUPP* = Types.UniversalProcPtr;
- ADSPCompletionUPP* = Types.UniversalProcPtr;
-
- DSPParamBlock* = (*ΔΔPACKEDΔΔ*) RECORD
- qLink*: OSUtils.QElemPtr (*ΔΔ POINTER TO OSUtils.QElem*);
- qType*: INTEGER;
- ioTrap*: INTEGER;
- ioCmdAddr*: Types.Ptr;
- ioCompletion*: ADSPCompletionUPP;
- ioResult*: Types.OSErr;
- ioNamePtr*: Types.StringPtr;
- ioVRefNum*: INTEGER;
- ioCRefNum*: INTEGER; (* adsp driver refNum *)
- csCode*: INTEGER; (* adsp driver control code *)
- qStatus*: LONGINT; (* adsp internal use *)
- ccbRefNum*: INTEGER;
- (*ΔΔ CASE INTEGER OF
- 0: ( *)
- END;
- DSPInitParamBlock* = RECORD(DSPParamBlock)
- ccbPtr*: TPCCB; (* pointer to connection control block *)
- userRoutine*: ADSPConnectionEventUPP; (* client routine to call on event *)
- sendQSize*: Types.UInt16; (* size of send queue (0..64K bytes) *)
- sendQueue*: Types.Ptr; (* client passed send queue buffer *)
- recvQSize*: Types.UInt16; (* size of receive queue (0..64K bytes) *)
- recvQueue*: Types.Ptr; (* client passed receive queue buffer *)
- attnPtr*: Types.Ptr; (* client passed receive attention buffer *)
- localSocket*: Types.UInt8; (* local socket number *)
- filler1*: Types.UInt8; (* filler for proper byte alignment *)
- (*ΔΔ );
- 1: ( *)
- END;
- DSPCLInitParamBlock* = DSPInitParamBlock;
- DSPOpenParamBlock* = RECORD(DSPParamBlock)
- localCID*: Types.UInt16; (* local connection id *)
- remoteCID*: Types.UInt16; (* remote connection id *)
- remoteAddress*: AppleTalk.AddrBlock; (* address of remote end *)
- filterAddress*: AppleTalk.AddrBlock; (* address filter *)
- sendSeq*: Types.UInt32; (* local send sequence number *)
- sendWindow*: Types.UInt16; (* send window size *)
- recvSeq*: Types.UInt32; (* receive sequence number *)
- attnSendSeq*: Types.UInt32; (* attention send sequence number *)
- attnRecvSeq*: Types.UInt32; (* attention receive sequence number *)
- ocMode*: Types.UInt8; (* open connection mode *)
- ocInterval*: Types.UInt8; (* open connection request retry interval *)
- ocMaximum*: Types.UInt8; (* open connection request retry maximum *)
- filler2*: Types.UInt8; (* filler for proper byte alignment *)
- (*ΔΔ );
- 2: ( *)
- END;
- DSPCLListenParamBlock* = DSPOpenParamBlock;
- DSPCLDenyParamBlock* = DSPOpenParamBlock;
- DSPCloseParamBlock* = RECORD(DSPParamBlock)
- abort*: Types.UInt8; (* abort connection immediately if non-zero *)
- filler3*: Types.UInt8; (* filler for proper byte alignment *)
- (*ΔΔ );
- 3: ( *)
- END;
- DSPRemoveParamBlock* = DSPCloseParamBlock;
- DSPReadParamBlock* = RECORD(DSPParamBlock)
- reqCount*: Types.UInt16; (* requested number of bytes *)
- actCount*: Types.UInt16; (* actual number of bytes *)
- dataPtr*: Types.Ptr; (* pointer to data buffer *)
- eom*: Types.UInt8; (* indicates logical end of message *)
- flush*: Types.UInt8; (* send data now *)
- (*ΔΔ );
- 4: ( *)
- END;
- DSPWriteParamBlock* = DSPReadParamBlock;
- DSPAttentionParamBlock* = RECORD(DSPParamBlock)
- attnCode*: Types.UInt16; (* client attention code *)
- attnSize*: Types.UInt16; (* size of attention data *)
- attnData*: Types.Ptr; (* pointer to attention data *)
- attnInterval*: Types.UInt8; (* retransmit timer in 10-tick intervals *)
- filler4*: Types.UInt8; (* filler for proper byte alignment *)
- (*ΔΔ );
- 5: ( *)
- END;
- DSPStatusParamBloc* = RECORD(DSPParamBlock)
- statusCCB*: TPCCB; (* pointer to ccb *)
- sendQPending*: Types.UInt16; (* pending bytes in send queue *)
- sendQFree*: Types.UInt16; (* available buffer space in send queue *)
- recvQPending*: Types.UInt16; (* pending bytes in receive queue *)
- recvQFree*: Types.UInt16; (* available buffer space in receive queue *)
- (*ΔΔ );
- 6: ( *)
- END;
- DSPOptionsParamBlock* = RECORD(DSPParamBlock)
- sendBlocking*: Types.UInt16; (* quantum for data packets *)
- sendTimer*: Types.UInt8; (* send timer in 10-tick intervals *)
- rtmtTimer*: Types.UInt8; (* retransmit timer in 10-tick intervals *)
- badSeqMax*: Types.UInt8; (* threshold for sending retransmit advice *)
- useCheckSum*: Types.UInt8; (* use ddp packet checksum *)
- (*ΔΔ );
- 7: ( *)
- END;
- DSPNewCIDParamBlock* = RECORD(DSPParamBlock)
- newcid*: Types.UInt16; (* new connection id returned *)
- (*ΔΔ );*)
- END;
-
- CONST
- uppADSPConnectionEventProcInfo* = $0000B802; (* Register PROCEDURE (4 bytes in A1); *)
- uppADSPCompletionProcInfo* = $00009802; (* Register PROCEDURE (4 bytes in A0); *)
-
- PROCEDURE NewADSPConnectionEventProc*(userRoutine: ADSPConnectionEventProcPtr): ADSPConnectionEventUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewADSPCompletionProc*(userRoutine: ADSPCompletionProcPtr): ADSPCompletionUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE CallADSPConnectionEventProc*(sourceCCB: TPCCB; userRoutine: ADSPConnectionEventUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL ; (*••*)
- (*To be implemented: Glue to move parameters into registers.*)
- (*$END*)
-
- PROCEDURE CallADSPCompletionProc*(thePBPtr: DSPPBPtr; userRoutine: ADSPCompletionUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL ; (*••*)
- (*To be implemented: Glue to move parameters into registers.*)
- (*$END*)
-
- (* $ALIGN RESET*)
- (* $POP*)
-
- END ADSP.
-